Repository navigation
feat(cloudflare): Instrument trace and tailStream handlers - #26250
Merged
isaacs merged 3 commits intoNov 11, 2026
Merged
Conversation
`withSentry` and `WorkerEntrypoint` instrumentation covered `tail`, but not the other two tail handlers that workerd still supports. workerd calls `trace` only when a worker does not export `tail`. Streaming tail workers export `tailStream`. Errors thrown by either handler were not captured. `trace` now gets the same wrapper as `tail`. `tailStream` needs more: workerd calls it once with the onset event, then calls the function or object it returns for each later batch of events. The wrapper also wraps that return value, so each event handler call runs as its own invocation and captures its errors. The mechanism types are `auto.faas.cloudflare.trace` and `auto.faas.cloudflare.tail_stream`, to match the existing `auto.faas.cloudflare.tail`. Closes #24038 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 130954d. Configure here.
Contributor
size-limit report 📦Compared: 0a4bb49 (PR test merge using develop at d6d803c) Against: d6d803c (develop) · base run #65636 ✅ Baseline matches: this diff contains only this PR's changes.
|
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 6 not successful, 51 successful. See the run.
Successful checks
|
JPeer264
reviewed
Nov 10, 2026
Unit tests in Node cannot show that workerd calls `tailStream` with the onset event and then calls the returned object for later events. This suite runs that flow in `wrangler dev` and checks that an error thrown by the returned `outcome` handler reaches Sentry. The consumer uses the Sentry Vite plugin. The producer is an auxiliary worker in the same Vite build, and it runs in the same `wrangler dev` process as the consumer. With wrangler 4.156, a streaming tail consumer in a separate `wrangler dev` process does not get the events: workerd logs that the worker "does not export a tailStream() handler", even for a plain worker that does export one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The object that `tailStream` returns is wrapped in a Proxy. Its `get` trap passed the Proxy as the receiver, so a getter ran with the Proxy as `this`. A getter that reads a private field then threw a `TypeError`. The trap now passes the raw object, the same `this` that methods get. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JPeer264
approved these changes
Nov 11, 2026
isaacs
deleted the
isaacschlueter/js-3573-cloudflare-no-tail_stream-or-trace
branch
November 11, 2026 10:26
51 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

withSentryandWorkerEntrypointinstrumentation coveredtail, but not the other two tail handlers that workerd still supports. workerd callstraceonly when a worker does not exporttail. Streaming tail workers exporttailStream. Errors thrown by either handler were not captured.tracenow gets the same wrapper astail.tailStreamneeds more: workerd calls it once with the onset event, then calls the function or object it returns for each later batch of events. The wrapper also wraps that return value, so each event handler call runs as its own invocation and captures its errors.The mechanism types are
auto.faas.cloudflare.traceandauto.faas.cloudflare.tail_stream, to match the existingauto.faas.cloudflare.tail.Closes #24038
Closes JS-3573